package com.mapper;

import com.javabean.Product;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ProductMapper {
    @Select("select * from product")
    List<Product> selectAll();
    @Select("select * from product where productName like concat('%',#{name},'%')")
    List<Product> selectLikeProductName(String name);

    @Select("select * from product where id=#{id}")
    Product selectById(int id);

    int updateProduct(Product product);

    int insertProduct(Product product);

    @Delete("delete from product where id=#{id}")
    int deleteById(int id);

    int deleteByList(List<Integer> ids);
}
